package de.koller.aframe.util.search;

public class ATile implements Comparable<ATile> {
	public final int posX, posY;
	double f = 0;
	double g = 0;
	ATile pre = null;
	
	public ATile( int posX, int posY ) {
		this.posX = posX;
		this.posY = posY;
	}

	@Override
	public int compareTo( ATile o ) {
		return Double.compare( f, o.f );
	}

	
	@Override
	public int hashCode() {
		int hash = 7;
		hash = 41 * hash + this.posX;
		hash = 41 * hash + this.posY;
		return hash;
	}

	@Override
	public boolean equals( Object obj ) {
		if( obj == null ) {
			return false;
		}
		if( getClass() != obj.getClass() ) {
			return false;
		}
		final ATile other = ( ATile ) obj;
		if( this.posX != other.posX ) {
			return false;
		}
		if( this.posY != other.posY ) {
			return false;
		}
		return true;
	}
	
}
